package com.bwie.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品团购信息
 * @TableName groupbuyingactivity_goods
 */
@TableName(value ="groupbuyingactivity_goods")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GroupbuyingactivityGoods {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 商品id
     */
    private Integer goodsId;

    @TableField(exist = false)
    private String goodsIdMode;

    public GroupbuyingactivityGoods(String goodsIdMode) {
        this.goodsIdMode = goodsIdMode;
    }

    public String getGoodsIdMode() {
        return goodsIdMode;
    }

    public void setGoodsIdMode(String goodsIdMode) {
        this.goodsIdMode = goodsIdMode;
    }



    /**
     * 团购id
     */
    private Integer group;

    /**
     * 活动库存
     */
    private Integer count;

    /**
     * 限购数量
     */
    private Integer restrictcount;

    /**
     * 活动库存预警值
     */
    private Integer prewarningvalue;

    /**
     * 成员人数
     */
    private Integer groupsize;

    /**
     * id
     */
    public Integer getId() {
        return id;
    }

    /**
     * id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 商品id
     */
    public Integer getGoodsId() {
        return goodsId;
    }

    /**
     * 商品id
     */
    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 团购id
     */
    public Integer getGroup() {
        return group;
    }

    /**
     * 团购id
     */
    public void setGroup(Integer group) {
        this.group = group;
    }

    /**
     * 活动库存
     */
    public Integer getCount() {
        return count;
    }

    /**
     * 活动库存
     */
    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 限购数量
     */
    public Integer getRestrictcount() {
        return restrictcount;
    }

    /**
     * 限购数量
     */
    public void setRestrictcount(Integer restrictcount) {
        this.restrictcount = restrictcount;
    }

    /**
     * 活动库存预警值
     */
    public Integer getPrewarningvalue() {
        return prewarningvalue;
    }

    /**
     * 活动库存预警值
     */
    public void setPrewarningvalue(Integer prewarningvalue) {
        this.prewarningvalue = prewarningvalue;
    }

    /**
     * 成员人数
     */
    public Integer getGroupsize() {
        return groupsize;
    }

    /**
     * 成员人数
     */
    public void setGroupsize(Integer groupsize) {
        this.groupsize = groupsize;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GroupbuyingactivityGoods other = (GroupbuyingactivityGoods) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getGroup() == null ? other.getGroup() == null : this.getGroup().equals(other.getGroup()))
            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
            && (this.getRestrictcount() == null ? other.getRestrictcount() == null : this.getRestrictcount().equals(other.getRestrictcount()))
            && (this.getPrewarningvalue() == null ? other.getPrewarningvalue() == null : this.getPrewarningvalue().equals(other.getPrewarningvalue()))
            && (this.getGroupsize() == null ? other.getGroupsize() == null : this.getGroupsize().equals(other.getGroupsize()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getGroup() == null) ? 0 : getGroup().hashCode());
        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
        result = prime * result + ((getRestrictcount() == null) ? 0 : getRestrictcount().hashCode());
        result = prime * result + ((getPrewarningvalue() == null) ? 0 : getPrewarningvalue().hashCode());
        result = prime * result + ((getGroupsize() == null) ? 0 : getGroupsize().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", goodsId=").append(goodsId);
        sb.append(", group=").append(group);
        sb.append(", count=").append(count);
        sb.append(", restrictcount=").append(restrictcount);
        sb.append(", prewarningvalue=").append(prewarningvalue);
        sb.append(", groupsize=").append(groupsize);
        sb.append("]");
        return sb.toString();
    }
}